package decorator;

/**
 * @author ycc
 * @date 2024/4/2
 * 创建具体的装饰者类，例如Milk和Mocha
 */
public class Milk extends CondimentDecorator {
    public Milk(Beverage beverage) {
        /**
         * 调用父级的构造方法 CondimentDecorator(Beverage beverage)
         */
        super(beverage);
    }

    @Override
    public double cost() {
        return beverage.cost() + 0.2;
    }
}
